<?php
$file_name = "../ptnhuan-web1/data/films.txt";
$file_path = realpath($file_name);
$films = array();
$file = fopen($file_path, "r") or exit("khong mo duoc");
while (!feof($file)) {
    $films[] = trim(fgets($file));
}

fclose($file);
?>
<?php foreach ($films as $team) : ?>
    <?php if (!empty($team)) : ?>
        <?php $film = explode(";", $team) ?><br>
        <?php if (isset($_GET['uid'])):  ?>
        
         <?php if((int)$_GET["uid"] == 0): ?>
        <img src = '../ptnhuan-web1/public/images/films/<?php echo $film[1] ?>'>
         <?php else :?>
        <?php if ((int) $_GET['uid'] == (int) $film[4]): ?>
       
         
            <img src = '../ptnhuan-web1/public/images/films/<?php echo $film[1] ?>'>
            <?php echo $film[2] ?>
            <?php echo $film[3] ?>
           <a href='edit.php?if=<?php echo$film[0]?>'>Edit</a>


        <?php endif; ?>
           
          <?php endif; ?> 

    <?php endif; ?>

    <?php endif; ?>

<?php endforeach; ?>




